#include "uhm/common.hxx"
#include "uhm/util.hxx"
#include "uhm/mat.hxx"

#include "uhm/mat/linal.hxx"

using namespace uhm;

int main (int argc, char **argv) {

  initialize(argc, argv);

  Mat_Linal_ A(Mat_Base_::DOUBLE, 10, 10);
  A.create_flat_without_buffer();
  A.create_flat_buffer();
  A.create_hier(3,3);

  Mat_Linal_ B(A);    
  B.create_flat_without_buffer();
  B.create_flat_buffer();
  B.create_hier(3,3);


  void *ptr = B.get_flat_buffer();

  Double_ storage, max_storage;
  storage_counter(storage, max_storage);
  std::cout << "Storage = " << storage << ", " << max_storage << "  Bytes\n";

  random_matrix(A);
    
  copy(A, B);
  std::cout << B;
    
  axpy(-1, A, B);

  std::cout << B.flat();
  std::cout << B.hier();

  A.free_all();
  B.free_all();

  finalize();

  return true;
}


